from core.exp_mgr import ExpMgr
from core.qlib_mgr import QlibMgr
from core.data_mgr import DataMgr
from core.model_mgr import load_linear_model, load_xgboost

if __name__ == '__main__':
    mgr = QlibMgr()
    #model = DataMgr().init_model()
    model = load_linear_model()
    #model = load_xgboost()
    print(model)

    features = ['Ref($close, 5)',
                'Ref($close, 10)',
                'Ref($close, 20)',
                ]
    names = ['return_5',   # 5日动量
             'return_10',  # 10日动量
             'return_20']  # 20日动量
    ds = mgr.prepare_dataset(features=features, names=names)
    #print(ds.prepare('train'))
    #print(ds.prepare('valid'))
    print(ds.prepare('test'))

    ExpMgr().run_simple(model, ds)
